<?php

namespace plugin\admin\app\model;

use plugin\admin\app\model\Base;
use const support\direction_types_remarks;
use const support\wallet_types_remarks;

/**
 * @property integer $id 钱包流水ID(主键)
 * @property integer $wallet_type 账户类型
 * @property integer $wallet_id 钱包id
 * @property integer $member_type 用户类型
 * @property string $member_id 用户id
 * @property integer $direction 资金流向 0未知 1流入 2流出
 * @property string $change_amount 变动金额
 * @property string $current_balance 当前余额
 * @property string $past_balance 操作前余额
 * @property integer $business_type 类型
 * @property string $business_type_name 类型名称
 * @property string $business_remark 业务发生时备注
 * @property integer $is_show 是否显示，1显示，2不显示
 * @property integer $operate_type 操作类型，1自动，2手动
 * @property integer $operator_id 操作人id
 * @property string $operator_name 操作人姓名
 * @property integer $create_time 创建时间
 * @property integer $update_time 更新时间
 */
class RlMemberWalletLog extends Base
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'rl_member_wallet_logs';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';
    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    public function getWalletNameAttribute($value): string
    {
        return wallet_types_remarks[$this->wallet_type]??'';
    }

    public function getDirectionTitleAttribute($val): string
    {
        return direction_types_remarks[$this->direction]??'';
    }

    public $appends=[
        'wallet_name','direction_title'
    ];
    
}
